import java.util.Arrays;

/*
class Student{
    String name;
    int age;
    double score;
    String sex;

    public Student() {
        System.out.println("这是一个无参构造方法");
    }

    public Student(String name, int age, double score, String sex) {
        this.name = name;
        this.age = age;
        this.score = score;
        this.sex = sex;
    }

    public void fill(String name, int age, double score, String sex){
        this.name = name;
        this.age = age;
        this.score = score;
        this.sex = sex;
    }
    public void prin(){
        System.out.println("姓名:"+name+"  年龄:"+age+"  成绩:"+score+"  性别:"+sex);
    }

    @Override
    public String toString() {
        return "Student{" +
                "name='" + name + '\'' +
                ", age=" + age +
                ", score=" + score +
                ", sex='" + sex + '\'' +
                '}';
    }
}
*/
class One{
    int a =1;
    int b = 20;
}
class Two extends One{
    int a = 10;
    public void fun(){
        System.out.println(a);
        super.a = 100;
        System.out.println(super.a);

    }
    public void fun2(){
        System.out.println(a);
    }
}
public class Demo1 {
    public static void main(String[] args) {
        Two two = new Two();
        two.fun();
        System.out.println(two.a);
        One one = new One();
        System.out.println(one.a);
       /* Two two = new Two();
        two.fun();
        System.out.println(two.b);
        One one = new One();
        System.out.println(one.a);
        System.out.println(two.a);*/
        //    System.out.println(two.a);
    //    System.out.println(one.a);
    //    Two two2 = new Two();
    //    two.fun2();
    }
    /*int a = 10;
    static int b = 20;
    public static void main(String[] args) {
        Demo1 demo1 = new Demo1();
        System.out.println(demo1.a);
        demo1.main1();
    }

    public void main1() {
        System.out.println(b);
    }*/
    /*public static void main(String[] args) {

        int[] arr1 = {1,2,3};
        int[] arr2 = {1,2,3};
        System.out.println("结果： " + Arrays.equals(arr1, arr2));
        Student stu = new Student();
        Student stu1 = new Student();
        //构造方法在对象的生命周期内，只能调用一次 stu1.Student();

        stu.fill("张三",22,99.99,"男");
        stu.score = 100.00;
        System.out.println("aaa");

    }*/

    /*public static void main(String[] args) {
        int[] arr = {3,2,32,44,55};
        for (int i = 0; i <arr.length-1 ; i++) {
            int ret = 0;
            for (int j = 0; j < arr.length-1-i; j++) {
                if(arr[j]>arr[j+1]){
                    int a = 0;
                    a=arr[j];
                    arr[j]=arr[j+1];
                    arr[j+1]=a;
                    ret++;
                }
            }
            if(ret == 0){
                break;
            }
        }
        System.out.println(Arrays.toString(arr));
    }*/
    /*public static void main(String[] args) {
        int[] arr1 = {1,2,3};
        int[] arr2 = {1,2,3};
        int[] arr3 = new int[10];
        Arrays.fill(arr3,1);
        System.out.println(Arrays.equals(arr1, arr2));
        System.out.println(Arrays.toString(arr3));
    }
    public static void main1(String[] args) {
        int[] arr = {2,4,3,55,6,11,1};
        Arrays.sort(arr);
        System.out.println(Arrays.toString(arr));
        int a = Arrays.binarySearch(arr,1);
        System.out.println(a);
    }*/
    /*public static int two(int[] arr,int x){
        int left = 0;
        int right = arr.length-1;
        while(left<=right){
            int mid = (left+right)/2;
            if(arr[mid]==x){
                return mid;
            }else if(arr[mid]<x){
                left = mid + 1;
            }else{
                right = mid-1;
            }
        }
        return -1;
    }
    public static void main(String[] args) {
        int[] arr = {1,2,3,4,5};
        int a = two(arr,11);
        if(a>-1){
            System.out.println("找到了，下标为 " + a);
        }else{
            System.out.println("找不到");
        }
    }*/
    /*public static void main(String[] args) {
        int[] arr = {1,2,3,4};
        int[] a = arr.clone();
        *//*int[] a = new int[arr.length];
        System.arraycopy(arr,0,a,0,arr.length);*//*
        *//*int[] a = Arrays.copyOf(arr,arr.length);*//*
        System.out.println(Arrays.toString(a));
    }*/

 /*   public static String dock(int[]  arr) {
        String S  = "[";
        for (int i = 0; i < arr.length; i++) {
            S += arr[i];
            if(i<arr.length-1){
                S += ",";
            }
        }
        S += "]";
        return S;
    }

    public static void main(String[] args) {
        int[] arr = {1,2,3,4,5};
        String a = dock(arr);
        System.out.println(a);
    }*/

    /*public static void dock(int[]  arr) {
        *//*String S  = "";*//*
        System.out.print("[");
        for (int i = 0; i < arr.length; i++) {
            System.out.print(arr[i]);
            if(i<arr.length-1){
                System.out.print(",");
            }
        }
        System.out.println("]");
        //return S;
    }

    public static void main(String[] args) {
        int[] arr = {1,2,3,4};
        dock(arr);
        *//*String a = dock(arr);
        System.out.println(a);*//*
    }*/

    /*public static int[] arr(){
        int[] arr = {1,2,3,4};
        return arr;
    }

    public static void main(String[] args) {
        int[] ret = arr();
        System.out.println(Arrays.toString(ret));
    }*/

    /*public static void main(String[] args) {
        int[] array;
        array = new int[] {1,2,3};
        String a = Arrays.toString(array);
        System.out.println(array);
        System.out.println(a);
    }
    public static void main1(String[] args) {
        int[] arr = {1,2,3,4};
        for(int x : arr){
            System.out.println(x);
        }
        String ret = Arrays.toString(arr);
        System.out.println(ret);
    }*/
    /*public static void main(String[] args) {
        System.out.println(rit(6));
        System.out.println(rit(7));
        System.out.println(rit(8));
    }*/
   /* public static int rit(int a){
        int count = 0;
        if(a==1){
            return 0;
        }
        if(a==2){
            return 1;
        }
        int f1 = 0;
        int f2 = 1;
        int f3 = 0;
        for(int i = 3;i<=a;i++){
            f3=f2+f1;
            f1=f2;
            f2=f3;
        }
        return f3;
    }*/
    /*public static int rit(int a){
        int count = 0;
        if(a==1){
            return 0;
        }
        if(a==2){
            return 1;
        }
        count = rit(a-1)+rit(a-2);
        return count;
    }*/
    /*public static void main(String[] args) {
        int[] arr={1,2,3,4,5};
        atr(arr,arr.length);
        System.out.println("哈哈哈");
    }

    public static void atr(int[] arr,int a) {
       *//* if(1==a){
            System.out.println(arr[a-1]);
            return;
        }*//*
        if(a>1){
            atr(arr,a-1);
        }
        System.out.println(arr[a-1]);
    }*/
   /* //递归
    public static void main(String[] args) {
        System.out.println(add(1234));
    }
    public static int add(int a){
        int count = 0;
        if(a<10){
            System.out.println(a);
            return a;
        }
        count =(a%10) + add(a/10);
        System.out.println(count);
        return count;
    }*/
  /*  //hasNextInt 循环执行代码，遇到非数字停止
    public static void main(String[] args) {
        Scanner scanner = new Scanner(System.in);
        while(scanner.hasNextInt()){
            int a = scanner.nextInt();
            System.out.println(a);
        }
    }*/
    /*public static void main(String[] args) {
        Scanner scanner = new Scanner(System.in);
        int count = 3;
        while(count != 0){
            String a = scanner.nextLine();
            if(a.equals("123")){
                System.out.println("登陆成功");
                return;
            }else{
                count--;
                System.out.println("你还有 "+count+"次机会");
            }
        }
    }*/
    /*public static void main(String[] args) {
        int count = 0;
        int num = -1;
        while(num != 0){
            count++;
            num=num&(num-1);
        }
        System.out.println(count);
    }*/
    /*public static void main(String[] args) {
        int a = -1;
        int count = 0;
        while(a!=0){
            if((a&1)==1){
                count++;
            }
            a=(a>>>1);
        }
        System.out.println(count);
    }*/
    /*public static void main(String[] args) {
        Scanner scanner = new Scanner(System.in);
        int a = 999999;
       for(int v = 1;v<=a;v++){
           int wei = 1;
           int ret = v;
           while(ret/10 != 0){
               wei++;
               ret /= 10;

           }
           //
           ret = v;
           int count = 0;
           while(ret != 0){
               int yu = ret%10;
               count += Math.pow(yu,wei);
             *//*  int sum = 1;
               int x =1;
               while(x<=wei){
                   sum *= yu;
                   x++;
               }
               count += sum;

              *//*
               ret /= 10;

           }
           if(count == v){
               System.out.println(v);
           }
       }
    }*/
   /* public static boolean isrui(int a) {
        for(int x = 2;x<=Math.sqrt(a);x++){
            if(a%x==0){
                return false;
            }
        }
        return true;
    }
    public static void main(String[] args) {
        int a = 4;
        if(isrui(a)){
            System.out.println("是素数");
        }else{
            System.out.println("不是素数");
        }
    }*/

    //Math.sqrt(),求平均数  alt+7查看所有方法

   /* public static void main(String[] args) {
        //计算1~n的阶乘
        System.out.println("请输入要计算的阶乘");
        Scanner scanner = new Scanner(System.in);
        int n = scanner.nextInt();
        int a = 1;
        int count = 0;
        while(a <= n){
            int b =1;
            int sum = 1;
            while(b<=a){
                sum *= b;
                b++;
            }
            count+=sum;
            a++;
        }
        System.out.println(count);
    }*/
   /* public static void main(String[] args) {
        Random random = new Random();
        int a = random.nextInt(50);//[0 50)
        System.out.println(a);
    }*/
    /*public static void main(String[] args) {
        Scanner scanner = new Scanner(System.in);
        String a = scanner.nextLine();
        System.out.println(a);
    }*/
    /*public static void main1(String[] args) {
       int  i = 1;
       while(i<=100){
           if(i%3==0 && i%5==0){
                   System.out.println(i);
           }
           i++;
       }
    }*/
}
